<?php 
@session_start();

class AdminLogOut {
	public static function LogOut() {
		$MyOldId = $_SESSION['UserId'];
		$_SESSION = array(); //unsets all variables
		
		if(ini_get("session.use_cookies")) {
			$MyParams = session_get_cookie_params();
    		setcookie(session_name(), '', time() - 42000, $MyParams["path"], 
    			$MyParams["domain"], $MyParams["secure"], $MyParams["httponly"]);
		}
		
		session_destroy();
	}
}
?>